<template>
  <div class="content_sides">
    <div class="content_side content_side__left">
      <div class="main_title_wrapper">
        <div class="main_subtitle">{{ subtitle }}</div>
        <div class="main_title">{{ title }}</div>
      </div>
      <NextButton v-if="showNextButton" @click="$emit('next')" />
    </div>
    <div class="content_side content_side__right">
      <div class="about_blocks">
        <FactItem 
          v-for="fact in facts" 
          :key="fact.id" 
          :id="fact.id" 
          :icon="fact.icon" 
          :text="fact.text" 
        />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import FactItem from './FactItem.vue';
import NextButton from './NextButton.vue';

interface Fact {
  id: string;
  icon: string;
  text: string;
}

defineProps<{
  subtitle: string;
  title: string;
  facts: Fact[];
  showNextButton?: boolean;
}>();

defineEmits<{
  (e: 'next'): void;
}>();
</script>

<style scoped>
.content_sides {
  width: 100%;
  max-width: 150rem;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 0;
  transition: 0.5s;
  opacity: 1;
}

.content_side__left {
  width: 40%;
  padding-right: 3rem;
}

.content_side__right {
  width: 60%;
}

.main_title_wrapper {
  position: relative;
  line-height: 1;
  margin-bottom: 4rem;
}

.main_subtitle {
  font-size: 1.8rem;
  color: #e58707;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.main_title {
  font-size: 7.2rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.2;
  margin-bottom: 2rem;
}

/* About blocks 网格布局 - 移除局部样式，使用全局样式 */

/* 响应式设计 */
@media screen and (max-width: 1499px) {
  .main_title {
    font-size: 6rem;
  }
}

@media screen and (max-width: 1024px) {
  .content_sides {
    padding: 0 2rem;
  }
  
  .main_title {
    font-size: 5rem;
  }
  
  .main_title_wrapper > :not(:last-child) {
    margin-bottom: 2rem;
  }
}

@media screen and (max-width: 991px) {
  .content_sides {
    flex-direction: column;
    opacity: 1;
  }
  
  .content_sides > :not(:last-child) {
    padding-bottom: 4rem;
  }
  
  .content_side__left {
    padding-right: 0;
  }
  
  .content_side__left,
  .content_side__right {
    width: 100%;
  }
  
  .main_title_wrapper {
    margin-bottom: 3rem;
  }
}

@media screen and (max-width: 767px) {
  .main_title {
    font-size: 3.4rem;
  }
}

@media screen and (max-width: 420px) {
  .main_title {
    font-size: 3rem;
  }
  
  .content_sides > :not(:last-child) {
    padding-bottom: 1rem;
  }
}
</style>